package minishell.object;


public class PairObject<T, V> implements IObject<String>
{
	private static final String KEY = "key";
	private static final String VALUE = "value";
	private static final String[] PROPERTIES = { KEY, VALUE };
	
	private T first = null;
	private V second = null;
	
	public PairObject( T first, V second )
	{
		this.first = first;
		this.second = second;
	}

	public Object getValue( String property )
	{
		if( KEY.equals( property ) )
			return first;
		if( VALUE.equals( property ) )
			return second;
		return null;
	}

	public String getPrimitive()
	{
		return this.toString();
	}

	public String[] properties()
	{
		return PROPERTIES;
	}

	public String toString()
	{
		return String.valueOf( first ) + " = " + String.valueOf( second );
	}
}
